﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CashFlow.Entities.Models;

namespace CashFlow.FakeData
{
	public static class CashFlowProvider
	{
		public static CashFlowListModel GetCashFlow(int numberOfDays)
		{
			var random = new Random();
			var cashFlowItems = Enumerable.Range(0, numberOfDays).
				Select(i => new CashFlowListItem
				{
					Amount = random.Next(-2000, 2000).ToString("C"),
					Balance = random.Next(-10000, 10000).ToString("C"),
					Date = DateTime.Now.AddDays(i).ToShortDateString(),
					Description = "descr " + i.ToString(),
					BillId = i.ToString(),
					AmountNumberClass = "negNumber",
					Payee = "payee " + i.ToString(),
					BalanceNumberClass = "posNumber"
				});
			var cashFlow = new CashFlowListModel
			{
				MonthValue = "2001",
				MonthLabel = "October, 2010",
				BeginningBalance = "10,000",
				EndingBalance = "2,000",
				Items = cashFlowItems
			};

			return cashFlow;
		}
	}
}
